﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace OpenRPOS
{
    public static class Globals
    {

        // String Constants
        public const string k_str_cannot_connect = "Unable to connect to server";
        public const string k_str_invalid_login = "Invalid Username/Password";

        // Numeric Constants
        public const double k_dbl_button_spacing = 10.0;
        public const double k_dbl_radio_button_height = 25.0;
        public const double k_dbl_checkbox_height = 16.0;
        public const double k_dbl_option_padding = 3.0;
        public const double k_dbl_option_group_min_height = 80.0;
        public const double k_dbl_option_group_width = 150;
        public const double k_dbl_tab_height = 30;

        public const int k_int_status_open = 0;
        public const int k_int_status_sent = 1;
        public const int k_int_status_closed = 2;

        // Misc. Data
        public static string username;
        public static int loginID;
        public static int token;
        public static bool bInit = false;
        public static ServiceReferenceOpenRPOS.Employee currentEmployee;
        public static ServiceReferenceOpenRPOS.Login currentLogin;

        // Screens
        public static Login login = new Login();
        public static MainPage mainPage = new MainPage();

        // Root display
        public static ScrollViewer root;

        // Database interface class
        public static DatabaseInterface db = new DatabaseInterface();

        public static void showWaitCursor(bool wait)
        {
            Globals.mainPage.WaitCursor.Visibility = (wait) ? Visibility.Visible : Visibility.Collapsed;
            Globals.mainPage.WaitCursor.Width = (wait) ? Globals.mainPage.border.ActualWidth-10 : 0;
            Globals.mainPage.WaitCursor.Height = (wait) ? Globals.mainPage.border.ActualHeight-10 : 0;
            Globals.mainPage.WaitCursor.Cursor = (wait) ? Cursors.Wait : Cursors.Arrow;
        }

        public static void Init()
        {
            // Initialize the display area
            root = new ScrollViewer();
            root.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            root.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
        }

    }
}
